Where() and orWhere()

  • STEP

    1. orWhere() method

    to get specific row(s) from a table

    2. Syntax

    
                        $model_object->orWhere()
                    

    3. Parameters

    The orWhere() method accepts basically three parameters;

    
                    1. The column name
                    2. The operator(optional)
                    3. The query value
                    

    4. Example

    Query
    
                    Student::where('name', '=', 'manoj')->orWhere('age', '>', '10')->get();
                    
    Output
    
                        select * from students where name='manoj' OR age>'10'